package com.woniuxy.dudugua.service.impl;

import com.woniuxy.dudugua.entity.Category;
import com.woniuxy.dudugua.mapper.CategoryMapper;
import com.woniuxy.dudugua.mapper.ProductMapper;
import com.woniuxy.dudugua.service.FoodService;
import com.woniuxy.dudugua.util.view.OverseasView;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FoodServiceImpl  implements FoodService {
    @Resource
    private ProductMapper  productMapper;
    @Resource
    private CategoryMapper categoryMapper;
    @Override
    public List<OverseasView> selectByProductFood() throws Exception {
        List<OverseasView> food = productMapper.selectByProductFood();
        if(food!=null){
            return  food;
        }
        return null;
    }

    @Override
    public List<Category> selectByProductFoodIdSon() throws Exception {
        List<Category> foodIdSon = categoryMapper.selectByProductFoodIdSon();
        if(foodIdSon!=null){
            return  foodIdSon;
        }
        return null;
    }
}
